package hot100;

/**
 * @author aodre , QQ : 480029069
 * @date 2023/9/19 22:10
 */
public class lc713乘积小于k的子数组 {




    public int solve(int nums[],int k){
        if(k == 0 || k == 1){
            return 0;
        }
        int ans = 0;
        int l = 0 ,r = 0, sum = 1;
        while(r < nums.length){
            sum *= nums[r];
            while(sum >= k){
                sum /= nums[l++];
            }
            ans += r - l + 1;
            r++;
        }
        return ans;
    }


}
